/**
 * 所有路由的入口
 */

module.exports = (app) => {
    // 路由命名空间
    // require('./router/index')(app);
    const { jwt, middleware } = app;
    const { routerHandler, tokenHandler } = middleware;
    const apiRouter = app.router.namespace('/api', routerHandler({}, app));
    app.apiRouter = apiRouter;
    const adminRouter = app.router.namespace('/admin', tokenHandler({}), routerHandler({}, app));
    app.adminRouter = adminRouter;
    require('./rootRouter/adminRouter')(app);
    
};
